package DateUtilExample;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;

public class CalenderExample {
	public static void main(String[] args)
    {
		CalenderExample tdt = new CalenderExample();
        tdt.doMath();
        Calendar now= Calendar.getInstance();
        String months[]={"January","February","March","April"};
        
        System.out.println("Current Year is :"+now.get(Calendar.YEAR));
        System.out.println("Current Month is :"+now.get(Calendar.MONTH));
        System.out.println("Current Month is"+months[now.get(Calendar.MONTH)])

;    }
	
	
	void doMath(){
        Calendar calendar = new GregorianCalendar(2007,Calendar.JANUARY,1);
        printCalendar (calendar);
        calendar.add(Calendar.MONTH, 2);
        printCalendar (calendar);

	}
	private void printCalendar(Calendar calendar)
    {
        // define output format and print
        SimpleDateFormat sdf = new SimpleDateFormat("d MMM yyyy hh:mm aaa");
        String date = sdf.format(calendar.getTime());
        System.out.println(date);
        
        
    }

        
        
		
	
   

}
